# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=py3-cachecontrol
_realname=cachecontrol
pkgver=0.13.1
pkgrel=0
pkgdesc="httplib2 caching for requests"
url="https://github.com/ionrock/cachecontrol"
arch="noarch"
license="Apache-2.0"
depends="
	py3-msgpack
	py3-requests
	"
makedepends="
	py3-flit-core
	py3-gpep517
	"
checkdepends="
	py3-cherrypy
	py3-filelock
	py3-lockfile
	py3-mock
	py3-pytest-xdist
	py3-redis
	"
subpackages="$pkgname-pyc"
source="https://github.com/ionrock/$_realname/archive/refs/tags/v$pkgver/py3-cachecontrol-$pkgver.tar.gz"
builddir="$srcdir/$_realname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
a4647d1223f45d7ebbddea5c73eade6ffa297eceffccf9a44a9800a4ddf19cc866260af96bafc63e08a58f05360a6aae30eb569834509d0186bcf5acfbcb9a4e  py3-cachecontrol-0.13.1.tar.gz
"
